package com.zyx.javademo.str;

/**
 * @author Yaxi.Zhang
 * @since 2021/5/11 15:35
 * desc: 字符串demo类
 */
public class StrDemo {
    public static void main(String[] args) {
        splitDemo();
    }

    public static void doubleToString() {
        double d1 = 1.0123123;
        double d2 = -0.000001;
        double d3 = -1.12312;
        System.out.println(String.format("%+.2f", d1));
        System.out.println(String.format("%+.2f", d2));
        System.out.println(String.format("%+.2f", d3));
    }

    public static void splitDemo() {
        String str = " aa , bb , cc dd ee";
        for (String s : str.split(",")) {
            System.out.println(s.trim());
        }
    }
}
